<%
  java.util.Vector strSearchNames = (java.util.Vector)pageContext.getAttribute("searchnames");
  if(strSearchNames == null)
    strSearchNames = new java.util.Vector();
  String strCurSearchName = (String)pageContext.getAttribute("searchname");
  if(strCurSearchName == null)
    strCurSearchName = "";
  String strCurSearchValue = (String)pageContext.getAttribute("searchvalue");
  if(strCurSearchValue == null)
    strCurSearchValue = "";
  String strCurSearchValue1 = "";
  String strCurSearchValue2 = "";
  String comDisplay = "";
  String speDisplay = "none";
  for(int i=0;i<strSearchNames.size();i++)
  {
  	java.util.HashMap temp = (java.util.HashMap)strSearchNames.elementAt(i);
  	String colname = (String)temp.get("columnname");
  	String coltype = (String)temp.get("columntype");
  	if(strCurSearchName.length() == 0)
  	  strCurSearchName = colname;
  	if(strCurSearchName.equals(colname))
  	{
  		if(!coltype.equalsIgnoreCase("varchar"))
  		{
        comDisplay = "none";
        speDisplay = "";  		  
  		}
      int csvp = strCurSearchValue.indexOf("^");      
      if(csvp != -1 && !coltype.equalsIgnoreCase("varchar"))
      {
        strCurSearchValue1 = strCurSearchValue.substring(0,csvp);
        strCurSearchValue2 = strCurSearchValue.substring(csvp + 1);  
        strCurSearchValue = "";   		
		  }
  		if(csvp != -1 && coltype.equalsIgnoreCase("date"))
  		{
        strCurSearchValue1 = OvalTools.dateToString(strCurSearchValue1,(String)session.getAttribute("dateformat"));
        strCurSearchValue2 = OvalTools.dateToString(strCurSearchValue2,(String)session.getAttribute("dateformat"));   
  		  strCurSearchValue = "";
  	  }
  	}	
  }

  String strCurOrderByCol = (String)pageContext.getAttribute("orderbycolumn");
  if(strCurOrderByCol == null)
    strCurOrderByCol = "";
  String strCurOrderByType = (String)pageContext.getAttribute("orderbytype");
  if(strCurOrderByType == null || strCurOrderByType.length() == 0)
    strCurOrderByType = "DESC";
  Integer nCurMaxItem = (Integer)pageContext.getAttribute("maxitem");
  if(nCurMaxItem == null)
    nCurMaxItem = new Integer("5");
  Integer nCurPageNo = (Integer)pageContext.getAttribute("currentpage");
  if(nCurPageNo == null)
    nCurPageNo = new Integer("0");
  Integer nCurCount = (Integer)pageContext.getAttribute("count");
  if(nCurCount == null)
    nCurCount = new Integer(0);
  Integer nCurTotalPage = (Integer)pageContext.getAttribute("totalpage");
  if(nCurTotalPage == null)
    nCurTotalPage = new Integer(0);
  Integer nCurEndIndex = (Integer)pageContext.getAttribute("theendindex");
  if(nCurEndIndex == null)
    nCurEndIndex = new Integer(0);
  boolean bCurHasPre = false;
  boolean bCurHasNext = false;  
  if(nCurCount.intValue() != 0 && pageContext.getAttribute("haspre") != null)
    bCurHasPre = ((Boolean)pageContext.getAttribute("haspre")).booleanValue();
  if(pageContext.getAttribute("hasnext") != null)
    bCurHasNext = ((Boolean)pageContext.getAttribute("hasnext")).booleanValue();  
  int nCurRowCount = 0;
  if(nCurPageNo.intValue() < nCurTotalPage.intValue() && nCurPageNo.intValue() > 0)
    nCurRowCount = nCurMaxItem.intValue();
  else if(nCurPageNo.intValue() == nCurTotalPage.intValue() && nCurTotalPage.intValue() != 0)
  {
    nCurRowCount = nCurCount.intValue()%nCurMaxItem.intValue();
    if(nCurRowCount == 0)
      nCurRowCount = nCurMaxItem.intValue();
  }
%>
